<?php 
require_once 'sesi_login.php';
require_once 'konfigurasi.php';

fungsi('pengguna');

define('PAGE', 'Materi');
define('PAGE_ICO', 'icon-stats');
define('PAGE_URL', 'materi.php');

panggil_header();

koneksi_buka();

$text_q_materi = "select *, a.nama as m_nama, b.nama as k_nama 
						from materi a left join kelas b on a.tipe_kelas = b.tipe left join siswa c on b.id = c.kelas 
						where c.id = ".ID_SISWA;
						//echo $text_q_materi;
$q_materi = mysql_query($text_q_materi);

?>

<div class="content">
                
	<div class="page-header">
		<div class="icon">
			<span class="ico-arrow-right"></span>
		</div> 
		<h1> Materi<small>SDN I</small></h1>
	</div>
	

	<div class="row-fluid">
		<div class="span12">                

			<div class="block">
				<div class="head">                                
					<h2>Pencarian Materi</h2>
					<ul class="buttons">             
						<li><a href="#" onClick="source('form_pa'); return false;"><div class="icon"><span class="ico-info"></span></div></a></li>
					</ul>                                                                  
				</div>                                    
				<div class="data-fluid">
					<div class="row-form">
						<div class="span3">Materi</div>
						<div class="span9">
							<select name="materi" class="select" style="width: 100%;">
								<?php 
									while($dt_materi = mysql_fetch_array($q_materi)){?>
										<option value="<?php echo $dt_materi['file']; ?>"><?php echo $dt_materi['m_nama'].", kelas ".$dt_materi['k_nama'].", pertemuan ke ".$dt_materi['pertemuan_ke'];?></option>
								<?php 
									} ?>                                                                 
							</select>
						</div>
					</div>
					<!-- <div class="row-form">
						<div class="span3">Sub Materi</div>
						<div class="span9">
							<select name="s_example" class="select" style="width: 100%;">
								<option value="0">Umum</option>
								<option value="1">Karyawan</option>
								<option value="2">Spesial</option>                                                                    
							</select>
						</div>
					</div>                  
					<div class="row-form">
						<div class="span3">Deskripsi</div>
						<div class="span9"><textarea placeholder="Placeholder example"></textarea></div>
					</div>
					-->
					<div class="row-form">
						<div class="span3"></div>
						<div class="span9">                       
							<!-- <button class="btn btn-primary" type="button">Lihat</button> --> 							
							<button class="btn btn-success" id="btn-download" type="button">Download</button> 
							<!-- <button class="btn btn-warning" type="button">Batal</button> -->       
						</div>   
					</div>
				</div>        
			</div>
		</div>  
	</div> 

</div>
<div class="dialog" id="source" style="display: none;" title="Source"></div>

<?php
panggil_footer();
?>
